//package com.zzh.partnersys.im.rocketmq.consumer;
//
//import com.zzh.partnersys.chat.message.request.ApplyAddFriendRequestMessage;
//import com.zzh.partnersys.entity.UserApply;
//import com.zzh.partnersys.rocketmq.contant.MQConstant;
//import com.zzh.partnersys.service.UserApplyService;
//import org.apache.rocketmq.spring.annotation.MessageModel;
//import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
//import org.apache.rocketmq.spring.core.RocketMQListener;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * @author ??????
// * @version 1.0
// * ������Ӻ������������??
// */
//@RocketMQMessageListener(
//        topic = MQConstant.ADD_FRIEND_APPLY_TOPIC,
//        consumerGroup = MQConstant.CONSUMER_GROUP_ADD_FRIEND_APPLY,
//        messageModel = MessageModel.BROADCASTING)
//@Component
//public class AddFriendApplyMQConsumer implements RocketMQListener<ApplyAddFriendRequestMessage> {
//
//    @Autowired
//    private UserApplyService userApplyService;
//
//    @Override
//    public void onMessage(ApplyAddFriendRequestMessage applyAddFriendRequestMessage) {
//        Long toUid = applyAddFriendRequestMessage.getToUid();//���͸��ĸ��û�
//        Long fromUid = applyAddFriendRequestMessage.getFromUid();
//        String content = applyAddFriendRequestMessage.getContent();//���͸��ĸ��û�
//
//        //��ŵ�user_apply����
//        UserApply userApply = new UserApply();
//        userApply.setMsg(content);
//        userApply.setUid(fromUid);//˭��??
//        userApply.setTargetId(toUid);//Ҫ��˭��??
//        Long id = userApplyService.insertOneData(userApply);
//        if (id == null){
//            //todo
//            System.out.println("ʧ��");
//        }
//
//    }
//
//
//}
